﻿<?php
if($_GET['moda']=="delete"){
 $delete_termin='DELETE FROM termin WHERE dict_id="'.$_GET['id'].'"';
 $results_delete_termin=mysql_query($delete_termin);
 
 echo '
 <script type="text/javascript">
	alert("Успешно Изтриване!");
 </script>
 ';
echo '<meta http-equiv="refresh" content="0;url=termin.php?cat='.$_GET['cat'].'&amp;name='.$_GET['name'].'">';
} else{
$select_u=mysql_query('SELECT * FROM users WHERE username="'.$_SESSION['username'].'"');
$row_u=mysql_fetch_assoc($select_u);
	
	echo '<br />';
	$select_cat=mysql_query('SELECT * FROM termin WHERE cat="'.$_GET['cat'].'"');
	while($row_cat=mysql_fetch_assoc($select_cat)){
	echo '<div style="background-color: #E6E6E6; margin-right: 30px; padding: 4px; border-radius: 5px;">';
	echo '<p style="margin-left: 25px;"><b>'.$row_cat['term'].'</b>';
	echo '</p>';
	echo '<p style="margin-left: 25px; text-indent: 20px;">'.$row_cat['term_descr'].'</p>';
	echo '</div>';
	echo '<br />';
	}
	}
?>